﻿using DXApplicationTangche.UC.标签打印.Service;
using DXApplicationTangche.UC.金蝶;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.标签打印
{
    public partial class Form打印机配置文件 : DevExpress.XtraEditors.XtraForm
    {
        public PrintMachineDTO printMachineDTO = new PrintMachineDTO();
        public Form打印机配置文件(PrintMachineDTO printMachineDTO)
        {
            InitializeComponent();
            InitprinterComboBox();
            this.printMachineDTO = printMachineDTO;
        }
        private void InitprinterComboBox()
        {
            List<String> list = LocalPrinter.GetLocalPrinters(); //获得系统中的打印机列表
            foreach (String s in list)
            {
                printerComboBox.Items.Add(s); //将打印机名称添加到下拉框中
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.printMachineDTO.printName = printerComboBox.SelectedItem.ToString();
            this.Close();
        }
    }
}
